package com.atguigu.boot;

import com.atguigu.boot.controller.MVCController;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class MVCMainType {

    public static void main(String[] args) {
        // SpringBoot 启动过程的入口 run() 方法，会返回一个 IOC 容器对象
        ConfigurableApplicationContext applicationContext =
                SpringApplication.run(MVCMainType.class, args);

        // 可以从 IOC 容器中获取 bean
        MVCController mvcController = applicationContext.getBean(MVCController.class);

        String data = mvcController.getData();
        System.out.println("data = " + data);
    }

}
